RECOV=/home/swlee4skmt/bin/recov-re
NUM=/home/swlee4skmt/bin/giza/find_nums.pl

# series of recovering
ITR=`cat ../now-itr.var`
TYPE=`cat ../../info/rule_type.var`
SYMM=`cat ../../info/symm.var`

if [ $SYMM == int ]; then
	cp int-all.giza tmp-recov
fi
if [ $SYMM == uni ]; then
	cp uni-all.giza tmp-recov
fi
if [ $SYMM == st ]; then
	cp st-all.giza tmp-recov
fi

for(( j=${ITR}; j>0; j-- )); do
	let p=$j-1
	echo $j
	${RECOV} tmp-recov ../../i${p}/copycat/src.rinfo tmp_recov2
	rm -rf tmp-recov
	mv tmp_recov2 tmp-recov
done

if [ $SYMM == int ]; then
	mv tmp-recov int-all-recovered.giza
	perl ${NUM} -1 int-all-recovered.giza > int-all-recovered.nao
fi
if [ $SYMM == uni ]; then
	mv tmp-recov uni-all-recovered.giza
	perl ${NUM} -1 uni-all-recovered.giza > uni-all-recovered.nao
fi
if [ $SYMM == st ]; then
	mv tmp-recov st-all-recovered.giza
	perl ${NUM} -1 st-all-recovered.giza > st-all-recovered.nao
fi

exit

